package com.miao.generator.controller;

import com.miao.generator.dto.GeneratorDTO;
import com.miao.generator.service.GeneratorService;
import com.miao.util.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Tag(name = "代码生成器服务")
@RestController
@RequestMapping("generator")
@CrossOrigin
public class GeneratorController {

    @Autowired
    private GeneratorService service;


    @GetMapping("page")
    @Operation(summary = "获取数据库表列表")
    @Parameters({
            @Parameter(name = "pageSize", description = "分页限制", required = true),
            @Parameter(name = "currentPage", description = "页码", required = true)
    })
    public Result<Object> Page(@RequestParam(required = false) Map<String, Object> params) {
        return service.Page(params);
    }

    @PostMapping("generator")
    @Operation(summary = "生成代码")
    public Result<Object> Generator(@RequestBody GeneratorDTO dto) {
        return null;
    }

}
